#include<iostream>
#include<cstring>

using namespace std;

//int a[101];
int check(int n)
{
	int qian = n/1000;
	int tmp = n%1000;
	int bai = tmp/100;
	tmp = tmp%100;
	int shi = tmp/10;
	tmp = tmp%10;
	int ge = tmp;
	
	return ge-qian-bai-shi;		
}
void jsuan()
{
	int  n,x = 0 ;
	
	int cnt = 0;
	cin >> n;
	for (int i=1;i<=n;i++)
	{
		cin >> x;
		if (0<check(x))
		{
			cnt++;
			cout << x << endl; 
		}
			
	}	
	cout << cnt << endl;
}

int main()
{
	jsuan();
	return 0;	
} 
